<% if @question.errors.any? %>
  <div id="error_explanation">
    <h2><%= pluralize(@question.errors.count, "error") %> prohibited this question from being saved:</h2>

    <ul>
    <% @question.errors.full_messages.each do |msg| %>
      <li><%= msg %></li>
    <% end %>
    </ul>
  </div>
<% end %>

  <div class="field">
    <%= f.label :details %><br />
    <%= f.text_area :details %>
  </div>

  <div class="field">
    <%= f.label :position %><br />
    <%= f.number_field :position %>
  </div>

  <div class="field">
    <%= f.label :questionnaire_id %><br />
    <%= f.select :questionnaire_id, questionnaire_options, :include_blank => true %>
  </div>

    <div class=''>
      <%= f.fields_for :answers do |answer_fields| %>
        <div class='fields answer-div'>
          <%= render :partial => 'answer', :locals => { :f => answer_fields } %>
          <div class='clearfix'></div>
        </div>
      <% end %>
    </div>

  <p>
    <%= link_to "New Answer", '#add_answer', :class => 'add_association', 'data-association' => "answers" %>
  </p>

  <div id='answers_fields_template' style='display:none'>
    <div class='new_fields answer-div'>
      <%= f.fields_for :answers, Answer.new, :child_index => "new_answers" do |a_f|%>
        <%= render :partial => 'answer', :locals => { :f => a_f } %>
      <% end %>
      <div class='clearfix'></div>
    </div>
  </div>

  <div class="actions">
    <%= f.submit %>
  </div>
